package top.yxqz.studyenum;

import java.util.Arrays;

/**
 * @author Mr.余
 * @date 2022/11/11
 * @package top.yxqz.studyenum
 */
public class test1 {
    public static void main(String[] args) {
//        多态
        Games phoneGame = Games.PhoneGame;
        phoneGame.showGameName();

        Games.PhoneGame.showGameName();
        Games.PCGame.showGameName();
        Games.HandleGame.showGameName();
        System.out.println("------------------------");
        System.out.println(Games.PCGame.toString());
        System.out.println(Games.PCGame.name());
        System.out.println(Games.PCGame);

        Games pcGame = Games.PCGame;
        Games games = Games.valueOf(Games.PCGame + "");
        System.out.println("gamesName:"+games);
        System.out.println("PCGame在Games中的索引值："+pcGame.ordinal());

        System.out.println("-----------------------------------");
        Games handleGame =  Games.HandleGame;
//         compareTo一般用来比较位置
        int i = handleGame.compareTo(handleGame);
        System.out.println("比较结果："+i);

        Games[] values = Games.values();
        System.out.println(Arrays.toString(values));

    }


}
